package stud.mpgame.network.service.ping;

import org.apache.mina.core.buffer.IoBuffer;

import stud.mpgame.network.Message;
import stud.mpgame.network.UserObject;

/**
 * @author f.pavel91@gmail.com
 * @version 1.0
 */
public class PingNotificationUserObject extends UserObject {

    private int ping;

    public PingNotificationUserObject(int ping) {
        this.ping = ping;
    }

    public int getPing() {
        return ping;
    }

    @Override
    public void readExternal(IoBuffer buffer, Message owner) {
        this.ping = buffer.getInt();
    }

    @Override
    public void writeExternal(IoBuffer buffer, Message owner) {
        buffer.putInt(ping);
    }

}
